package com.imonsoft.sqm.dao.business.supplier_quality;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.imonsoft.common.httpModel.DataGrid;
import com.imonsoft.common.httpModel.Pager;
import com.imonsoft.sqm.pojo.business.supplier_quality.Special_Claim;
import com.imonsoft.sqm.pojo.business.supplier_quality.Special_ClaimExample;
import com.imonsoft.sqm.vo.business.supplier_quality.SpecialClaimVo;

@SuppressWarnings("deprecation")
@Repository("special_ClaimDAO")
public class Special_ClaimDAOImpl extends SqlMapClientDaoSupport implements Special_ClaimDAO {

    /**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public Special_ClaimDAOImpl() {
		super();
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public int countSpecial_ClaimByExample(Special_ClaimExample example) {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("tt_special_claim.ibatorgenerated_countByExample",
				example);
		return count;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public int deleteSpecial_ClaimByExample(Special_ClaimExample example) {
		int rows = getSqlMapClientTemplate().delete("tt_special_claim.ibatorgenerated_deleteByExample",
				example);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public int deleteSpecial_ClaimByPrimaryKey(Long id) {
		Special_Claim key = new Special_Claim();
		key.setId(id);
		int rows = getSqlMapClientTemplate().delete("tt_special_claim.ibatorgenerated_deleteByPrimaryKey",
				key);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public Long insertSpecial_Claim(Special_Claim record) {
		Object newKey = getSqlMapClientTemplate().insert("tt_special_claim.ibatorgenerated_insert",
				record);
		return (Long) newKey;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public Long insertSpecial_ClaimSelective(Special_Claim record) {
		Object newKey = getSqlMapClientTemplate().insert("tt_special_claim.ibatorgenerated_insertSelective",
				record);
		return (Long) newKey;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	@SuppressWarnings("unchecked")
	public List<Special_Claim> selectSpecial_ClaimByExample(Special_ClaimExample example) {
		List<Special_Claim> list = getSqlMapClientTemplate().queryForList("tt_special_claim.ibatorgenerated_selectByExample",
				example);
		return list;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public Special_Claim selectSpecial_ClaimByPrimaryKey(Long id) {
		Special_Claim key = new Special_Claim();
		key.setId(id);
		Special_Claim record = (Special_Claim) getSqlMapClientTemplate().queryForObject("tt_special_claim.ibatorgenerated_selectByPrimaryKey",
				key);
		return record;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public int updateSpecial_ClaimByExampleSelective(Special_Claim record,
			Special_ClaimExample example) {
		UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
		int rows = getSqlMapClientTemplate().update("tt_special_claim.ibatorgenerated_updateByExampleSelective",
				parms);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public int updateSpecial_ClaimByExample(Special_Claim record,
			Special_ClaimExample example) {
		UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
		int rows = getSqlMapClientTemplate().update("tt_special_claim.ibatorgenerated_updateByExample",
				parms);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public int updateSpecial_ClaimByPrimaryKeySelective(Special_Claim record) {
		int rows = getSqlMapClientTemplate().update("tt_special_claim.ibatorgenerated_updateByPrimaryKeySelective",
				record);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	public int updateSpecial_ClaimByPrimaryKey(Special_Claim record) {
		int rows = getSqlMapClientTemplate().update("tt_special_claim.ibatorgenerated_updateByPrimaryKey",
				record);
		return rows;
	}

	/**
	 * This class was generated by Apache iBATIS ibator. This class corresponds to the database table tt_special_claim
	 * @ibatorgenerated  Thu May 30 17:54:25 CST 2013
	 */
	private static class UpdateByExampleParms extends Special_ClaimExample {
		private Object record;

		public UpdateByExampleParms(Object record, Special_ClaimExample example) {
			super(example);
			this.record = record;
		}

		public Object getRecord() {
			return record;
		}
	}

	@SuppressWarnings("unchecked")
	@Override
	public DataGrid<SpecialClaimVo> getDataGridVoBy(Special_Claim entity, Pager pager) {

		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("tt_special_claim.ibatorgenerated_countBySpecial_Claim", entity);
		List<SpecialClaimVo> rows = getSqlMapClientTemplate().queryForList("tt_special_claim.ibatorgenerated_selectBySpecial_Claim", entity, pager.getSkipResults(), pager.getRows());
		DataGrid<SpecialClaimVo> dataGrid = new DataGrid<SpecialClaimVo>(count, rows);
		return dataGrid;
	}

	 
}